package org.yufan.service;

import org.yufan.bean.User;
import org.yufan.exception.CustomException;

/**
 * Created by zxd on 2018/3/29.
 */
public interface UserService {
    /**
     * 注册
     * @param user
     */
    public void register(User user) throws CustomException;

    /**
     * @param username
     * @param password
     * @return token 令牌
     */
    public String login(String username,String password) throws CustomException;

    public String loginByPhone(String phone,String sms_code) throws CustomException;

    /**
     * 根据token查询用户信息
     * @param token
     * @return
     */
    public User queryUserByToken(String token) throws CustomException;


    public User queryByPhone(String phone);

    /**
     * 校验
     * @param param
     * @param type
     * @return
     */
    public Boolean check(String param, Integer type) throws CustomException;
}
